home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / windownt / xvidiff.zip / NT.H < prev    next >
C/C++ Source or Header  |  1993-01-01  |  4KB  |  158 lines

  1. /* Copyright (c) 1990,1991,1992 Chris and John Downey */
  2. /***
  3.  
  4. * program name:
  5.     xvi
  6. * function:
  7.     PD version of UNIX "vi" editor, with extensions.
  8. * module name:
  9.     nt.h
  10. * module function:
  11.     Definitions for Windows NT system interface module.
  12. * history:
  13.     STEVIE - ST Editor for VI Enthusiasts, Version 3.10
  14.     Originally by Tim Thompson (twitch!tjt)
  15.     Extensive modifications by Tony Andrews (onecom!wldrdg!tony)
  16.     Heavily modified by Chris & John Downey
  17.  
  18. ***/
  19.  
  20. #include <errno.h>
  21. #include <fcntl.h>
  22. #include <time.h>
  23. #include <io.h>
  24. #include <string.h>
  25. #include <process.h>
  26. #include <direct.h>
  27.  
  28. /*
  29.  * Default value for helpfile parameter.
  30.  */
  31. #ifndef HELPFILE
  32. #   define  HELPFILE    "c:\\xvi\\help"
  33. #endif
  34.  
  35. #   define SETVBUF_AVAIL
  36.     /*
  37.      * These are the buffer sizes we use for reading & writing files.
  38.      */
  39. #   define  READBUFSIZ    16384
  40. #   define  WRTBUFSIZ    16384
  41.  
  42. #define STRERROR_AVAIL
  43.  
  44. /*
  45.  * Macros to open files in binary mode.
  46.  */
  47. #define fopenrb(f)    fopen((f),"rb")
  48. #define fopenwb(f)    fopen((f),"wb")
  49.  
  50. /* THIS SHOULD BE FIXED TO DO REAL FILENAME EXPANSION!!! */
  51. #define fexpand(f)    (f)
  52.  
  53. #define call_system(s)    system(s)
  54. #define call_shell(s)    spawnlp(0, (s), (s), (char *) NULL)
  55.  
  56. /*
  57.  * System-dependent constants - these are needed by file i/o routines.
  58.  */
  59. #   define  MAXPATHLEN    _MAX_PATH    /* max length of full path name */
  60. #   define  MAXNAMLEN    (_MAX_FNAME+1+_MAX_EXT)    /* max length of file name */
  61.  
  62. #ifndef W_OK
  63. #   define    F_OK    0
  64. #   define    W_OK    2
  65. #endif
  66.  
  67. #define exists(f)    (_access((f),F_OK) == 0)
  68. #define can_write(f)    (_access((f),F_OK) != 0 || _access((f), W_OK) == 0)
  69. #define chdir        _chdir
  70. #define getcwd        _getcwd
  71.  
  72. #define    DIRSEPS        "\\/"    /* directory separators within pathnames */
  73.  
  74. /*
  75.  * Default file format.
  76.  */
  77. #define DEF_TFF        fmt_MSDOS
  78.  
  79. /*
  80.  * These are needed for the termcap terminal interface module.
  81.  */
  82. #define oflush()    (void) fflush(stdout)
  83. #define moutch(c)    putchar(c)
  84.  
  85. /*
  86.  * Declarations for standard UNIX functions.
  87.  */
  88. extern    int        rename P((const char *, const char *));
  89.  
  90. /*
  91.  * Declarations for system interface routines in unix.c.
  92.  */
  93. extern    void        foutch P((int));
  94. extern    void        delay P((void));
  95. extern    void        sys_init P((void));
  96. extern    void        sys_startv P((void));
  97. extern    void        sys_endv P((void));
  98. extern    void        sys_exit P((int));
  99. extern    bool_t        sys_pipe P((char *, int (*)(FILE *), long (*)(FILE *)));
  100. extern    char        *tempfname P((char *));
  101.  
  102. /*
  103.  * From here on down is the terminal interface stuff.
  104.  */
  105. #include <conio.h>
  106.  
  107. #define can_ins_line    FALSE
  108. #define can_del_line    FALSE
  109. #define can_scroll_area TRUE
  110.  
  111. /*
  112.  * tty_linefeed() isn't needed if can_scroll_area is TRUE.
  113.  */
  114. #define tty_linefeed()
  115. #define can_inschar    FALSE
  116. #define inschar(c)
  117. #define cost_goto    0    /* cost of tty_goto() */
  118.  
  119. #define tty_close()
  120. #define vis_cursor()
  121. #define invis_cursor()
  122. #define insert_line()
  123. #define delete_line()
  124.  
  125. /*
  126.  * Colour handling: default screen colours for PC's.
  127.  */
  128. #define DEF_COLOUR    0
  129. #define DEF_STCOLOUR    1
  130. #define DEF_SYSCOLOUR    2
  131.  
  132. /*
  133.  * Screen dimensions.
  134.  */
  135. extern int    Columns;
  136. extern int    Rows;
  137.  
  138. /*
  139.  * Declarations for routines in ibmpc_a.asm & ibmpc_c.c:
  140.  */
  141. extern void        alert P((void));
  142. extern void        erase_display P((void));
  143. extern void        erase_line P((void));
  144. extern void        flush_output P((void));
  145. extern void        hidemouse P((void));
  146. extern int        inchar P((long));
  147. extern unsigned        mousestatus P((unsigned *, unsigned *));
  148. extern void        outchar P((int));
  149. extern void        outstr P((char *));
  150. extern void        scroll_down P((unsigned, unsigned, int));
  151. extern void        scroll_up P((unsigned, unsigned, int));
  152. extern void        set_colour P((int));
  153. extern void        showmouse P((void));
  154. extern void        tty_endv P((void));
  155. extern void        tty_goto P((int, int));
  156. extern void        tty_open P((unsigned *, unsigned *));
  157. extern void        tty_startv P((void));
  158.